<template>
    <div class="merchant-bd">
            <div @click="goDetail(item)" class="merchant-cell-card" :key="item.id" v-for="item in showOrders">
                <div class="clearfix">
                    <div class=" title-fz-color fl">{{item.name}}</div>
                    <div class="subtitle-fz-color fr">待处理</div>
                </div>
                <div class="clearfix">
                    <div class=" desc-fz-color fl">订单编号:{{item.orderNo}}</div>
                </div>
                <div class="clearfix">
                        <div class=" desc-fz-color fl">下单时间：{{item.payTime}}</div>
                        <div class="price-fz-color fr">￥{{item.clearPrice}}</div>
                    </div>
            </div>
        </div>
</template>

<script>
let axios = require("axios");
export default {
  data() {
    return {
      token: "",
      showOrders: []
    };
  },
  created() {
    let token = this.$route.params.token;
    this.token = token;
    this.getList(token);
  },
  methods: {
    getList(token) {
      let self = this;
      axios({
        method: "get",
        url: "/merchantcenter/cancellist",
        params: {
          token: token
        }
      }).then(function(res) {
        let data = res.data.data;
        self.showOrders = data;
      });
    },
    goDetail(item) {
      let orderNo = item.orderNo;
      let token = this.token;
      this.$router.push({
        name: "Detail",
        params: {
          token: token,
          orderNo: orderNo
        }
      });
    }
  }
};
</script>

<style>
</style>
